package com.qujia.station.service;

import java.math.BigDecimal;
import java.sql.Time;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.qujia.common.core.domain.AjaxResult;
import com.qujia.station.domain.*;
import com.qujia.station.domain.dto.CardClassSettDto;
import com.qujia.station.domain.dto.StationClassTimeDto;
import com.qujia.station.domain.vo.StationClassTimeVo;
import com.qujia.station.domain.vo.changeClassSettlement4User;
import org.apache.ibatis.annotations.Param;
import org.springframework.scheduling.annotation.Async;

/**
 * 班结Service接口
 * 
 * @author qujia
 * @date 2021-11-27
 */
public interface IClassSettlementService 
{
    /**
     * 查询班结
     * 
     * @param classSettlementId 班结ID
     * @return 班结
     */
    public ClassSettlement selectClassSettlementById(Long classSettlementId);

    /**
     * 查询班结列表
     * 
     * @param classSettlement 班结
     * @return 班结集合
     */
    public List<ClassSettlement> selectClassSettlementList(ClassSettlement classSettlement);

    /**
     * 查询班结汇总列表
     *
     * @param classSettlement 班结
     * @return 班结集合
     */
    public List<ClassSettlement> selectClassSettlementSummaryList(ClassSettlement classSettlement);

    public List<ClassSettlement> selectClassSettlementStaffSummaryList(ClassSettlement classSettlement);

    public List<ClassSettlement> classTimeList(ClassSettlement classSettlement);

    public List<BusinessDailyReport> selectClassSettlementSummaryListInReport(ClassSettlement classSettlement);

    public List<BusinessDailyReport> selectBusinessDailyReportList(ClassSettlement classSettlement);

    public BusinessDailyReport selectBusinessDailyReportSum(ClassSettlement classSettlement);


    public BusinessDailyReport selectBusinessDailyReportSumInReport(ClassSettlement classSettlement);


    public List<ReportSettlement> selectReportClassList(ClassSettlement classSettlement);

    public List<ClassSettlementCard> getTransactionSummary(CardClassSettDto settDto,Map<String, Object> params);

    public List<ClassSettlementCard> getStaffTransactionSummary(CardClassSettDto settDto,Map<String, Object> params);


    public List<ClassSettlement> getRefundSummary(CardClassSettDto settDto,Map<String, Object> params);

    public List<ClassSettlement> employeeGetRefundSummary(Map<String, Object> params);

    public List<ClassSettlement> selectClassSettlementSummary4POSList(Map<String,Object> params);

    public ClassSettlement selectClassSettlementSummary(ClassSettlement classSettlement);

    public ClassSettlement selectClassSettlementStaffSummary(ClassSettlement classSettlement);

    public Map<String, Object> classInfoByClassNo(String classNo);

    public List<Map<String, Object>> createList( ClassSettlement classSettlement);

    public List<Long> selectSysUserByCreateUser( Long createUser);

    public ClassSettlementInfo classPushInfoByClassNo(ClassSettlement classSettlement);

    public ReportSettlement selectClassReportmentSummary(ClassSettlement classSettlement);

    public List<ClassSettlementOilmachine> selectAllClassSettlementOilmachines(String classNo);

    public List<ClassSettlementCard> queryGroupByRecharge(List<Map<String, Object>> queryGroupByPayType,CardClassSettDto settDto);

    // 根据station_id修改白班时间
    public int updateDayShiftTimeById(Time dayShiftStartTime, Time dayShiftEndTime, Time nightShiftStartTime, Time nightShiftEndTime, StationClassTimeDto timeDto);

    // 根据station_id查看白班时间
    public StationClassTimeVo selectDayShiftTimeById();



    /**
     * 新增班结
     * 
     * @param classSettlement 班结
     * @return 结果
     */
    public int insertClassSettlement(ClassSettlement classSettlement);


    /**
     * 新增员工班结
     *
     * @param classSettlement 班结
     * @return 结果
     */
    public int insertStaffClassSettlement(ClassSettlement classSettlement);

    /**
     * 新增日报表
     *
     * @param classSettlement 班结
     * @return 结果
     */
    public int insertClassReport(ClassSettlement classSettlement);

    /**
     * 经营日报表
     *
     * @param stationId 班结
     * @return 结果
     */
    @Async
    public void insertBusinessDailyReportAsync(Long stationId,int isClass,String no,Date classEndTime,Date classStartTime);


    public void insertBusinessDailyReport(Long stationId,int isClass,String no,Date classEndTime,Date classStartTime);





    public CardClassSettDto countCardSett(List<ClassSettlementCard> settlementCardList);

    /**
     * 修改班结
     * 
     * @param classSettlement 班结
     * @return 结果
     */
    public int updateClassSettlement(ClassSettlement classSettlement);

    /**
     * 批量删除班结
     * 
     * @param classNo 需要删除的班结ID
     * @return 结果
     */
    public int deleteClassSettlementByClassNos(String[] classNo);

    /**
     * 删除班结信息
     * 
     * @param classSettlementId 班结ID
     * @return 结果
     */
    public int deleteClassSettlementById(Long classSettlementId);
    /**
     * 直接查看详情
     *
     * @param createStartTime 班结ID
     * @return 结果
     */
    public AjaxResult getInfoForOrder(String createStartTime,
                                      String createEndTime,
                                      Long stationId,
                                      CardClassSettDto settDto,
                                     int openStaffClassInStation );

    /**
     *
     * 员工权限下查询班结详情
     * 直接查看详情
     *
     * @param createStartTime 班结ID
     * @return 结果
     */
    public AjaxResult getEmployeeInfoForOrder(String createStartTime,
                                      String createEndTime,
                                      String oilPersonnelId,
                                              Map<String, Object> params);

    /**
     * 查询未班结信息
     *
     * @param params
     * @return 结果
     */


    public List<ClassSettlement> querySummaryByClassNoForOrder(Map<String, Object> params);

    public List<ClassSettlement> employeeQuerySummaryByClassNoForOrder(Map<String, Object> params);

    public List<ClassSettlement> queryUntreatedData(Map<String,Object> params);


    public List<CouponSummary> queryCouponSum(Map<String,Object> params);


    public List<changeClassSettlement4User> selectChange4User4POSListForOrderStaff(Map<String,Object> params);

    public List<changeClassSettlement4User> selectAllChangeForOrderStaff(Map<String,Object> params);



    public void selectChange4User4POSListForOrder(Map<String,Object> params);

    public void insertAboutOil(Map<String,Object> params,String no,String classEndTime,Long stationId);

    public List<changeClassSettlement4User> selectForRecharge(Map<String,Object> params);

    public List<ClassSettlement> employeeQueryUntreatedData(Map<String,Object> params);

    public BigDecimal forActualRechargeReceivedAmt(CardClassSettDto settDto,Map<String, Object> params);

    public BigDecimal homeRechargeReceivedAmt(Map<String, Object> params);

    public   List<ClassSettlementCard> homeRechargeReceivedAmtSeven(Map<String, Object> params);

    public BigDecimal forKillCouponAmt(Map<String, Object> params);

    public BigDecimal forSaleActivityAmt(Map<String, Object> params);

    public ClassSettlementCard forSaleActivity(Map<String, Object> params);


    public BigDecimal forSaleActivityCom(Map<String, Object> params);

    public BigDecimal refSaleActivityAmt(Map<String, Object> params);


    public BigDecimal employeeForKillCouponAmt(Map<String, Object> params);

    public ClassSettlementCard queryPhysicalCard(Map<String, Object> params);

    public ClassSettlementCard queryPhysicalCardRef(Map<String, Object> params);

    public ClassSettlementCard queryFleetCard(Map<String, Object> params);

    public ClassSettlementCard querySuperPay(Map<String, Object> params);

    public Map<String,Object> queryLastEndTime(Map<String,Object> params);

    public Map<String,Object> queryLastEndTimeStaff(Map<String,Object> params);

    public Map<String,Object> queryStartAndEnd(Map<String,Object> params);

    public List<ClassSettlement> querySummaryByClassNo(Map<String,Object> params);

    public List<ClassSettlement> querySummaryByClassNoAllData(Map<String,Object> params,CardClassSettDto settDto);

    public   List<Map<String, Object>> queryGroupByOilForOrder(Map<String, Object> params);

    public   List<Map<String, Object>> employeeQueryGroupByOilForOrder(Map<String, Object> params);

    public List<Map<String,Object>> queryGroupByOil(Map<String,Object> params);


    public List<Map<String,Object>> queryReportByOil(Map<String,Object> params);

    public List<Map<String,Object>> queryGroupDiscountByOilForOrder(Map<String,Object> params);

    public List<Map<String,Object>> queryGroupByPayType(Map<String,Object> params);

    public List<Map<String,Object>> queryReportByPayType(Map<String,Object> params,CardClassSettDto settDto);

    public BigDecimal getAllTransaction(Map<String,Object> params,CardClassSettDto settDto);

    public int getAllNewPeople(Map<String,Object> params);

    public BigDecimal totalWordCount(ClassSettlement classSettlement);

    public List<Map<String, Object>> getShiftHandover(Map<String, Object> params);

    public List<Map<String, Object>> getSuccession(Map<String, Object> params);

    public List<Map<String, Object>> queryGroupByPayTypeForOrder(Map<String, Object> params);

    public List<Map<String, Object>> employeeQueryGroupByPayTypeForOrder(Map<String, Object> params);

    public List<Map<String,Object>> queryGroupByOilGun(Map<String,Object> params);

    public List<Map<String,Object>> queryReportByOilGun(Map<String,Object> params);

    public List<Map<String, Object>> queryGroupByOilGunForOrder(Map<String, Object> params);

    public List<Map<String, Object>> employeeQueryGroupByOilGunForOrder(Map<String, Object> params);

    public List<Map<String,Object>> queryGroupByActivity(Map<String,Object> params);

    public List<Map<String,Object>> queryGroupByActivityForOrder(Map<String,Object> params);

    public List<Map<String,Object>> selectClassSettlement4User4POSList(Map<String, Object> params);

    public List<Map<String,Object>> selectClassSettlement4User4POSListForOrder(Map<String, Object> params);

    public List<Map<String,Object>> employeeSelectClassSettlement4User4POSListForOrder(Map<String, Object> params);

    //统计班结信息，按照支付方式进行集合
    public List<ClassSettlement> queryClassSettlementPayType(Map<String, Object> params);

    //统计班结信息，按照油品名称进行集合
    public List<ClassSettlement> queryClassSettlementOil(Map<String, Object> params);

    //统计是白班还是夜班
    public String queryClassDayOrNight(Long stationId, Date createEndTime);

    //统计数量
    public int getDayOrNightCount(Map<String, Object> params);

    //统计班结信息，按照加油员分类
    public List<ClassSettlement> selectClassSettlementSummaryUser(Map<String, Object> params);


    void updateClassSettlementPrintStatus(String classNo);


}
